package com.ypx;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebListener;
import javax.servlet.annotation.WebServlet;

/**
 * @author Tang
 * @date 2023/2/20
 */
@MapperScan("com.ypx.mapper")  //作用：扫描com.ypx.mapper包下的所有接口，并为dao生成代理对象交由容器管理
@EnableTransactionManagement    //作用：开启事务注解功能
@SpringBootApplication
//在SpringBoot项目中, 在引导类/配置类上加了该注解后,会自动扫描项目中(当前包及其子包下)的
// @WebServlet , @WebFilter , @WebListener 注解, 自动注册Servlet的相关组件 ;
@ServletComponentScan
@EnableCaching//开启注解缓存功能
@Slf4j
public class ReggieApplication {
    public static void main(String[] args) {
        log.info("项目启动完成！");
        SpringApplication.run(ReggieApplication.class, args);
    }
}
